<template>
  <view>
    <view class="opinion" v-if="isEmpty">
      <view v-for="(item, index) in data['changeShiftLogList']" :key="index + 'a'">
        <view class="log-row" v-if="item.logType == '0' || item.logType == '7'">
          <view>
            <text class="log-row-yuan">{{ item.logType === '0' ? '交班班长' : '接班班长' }}：</text
            ><text>{{ item.handoverUserName || item.takeoverUserName || '--' }}</text>
          </view>
          <view
            ><text>处理时间：</text><text>{{ item.handoverTime || item.takeoverTime || '--' }}</text></view
          >
          <view class="log-row-long">
            <text>{{ item.logType === '0' ? '交班班长' : '接班班长' }}意见说明：</text>
            <text style="padding-top: 20rpx">{{ item.handoverRemark || item.takeoverRemark || '--' }}</text>
          </view>
        </view>
      </view>
      <!-- <view  v-for="(item,index) in list1" :key="index + 'a'">
				<view class="log-row" v-if="item.value.handoverUserName">
					<view><text
							class="log-row-yuan">交班{{item.label}}：</text><text>{{item.value.handoverUserName || '--'}}</text>
					</view>
					<view><text>处理时间：</text><text>{{item.value.handoverTime || '--'}}</text></view>
					<view class="log-row-long">
						<text>交班{{item.label}}意见说明：</text>
						<text style="padding-top: 20rpx;">{{item.value.handoverRemark || '--'}}</text>
					</view>
				</view>
			</view>
			<view v-for="(item,index) in list2" :key="index + 'b'">
				<view class="log-row" v-if="item.value.takeoverUserName">
					<view><text
							class="log-row-yuan">接班{{item.label}}：</text><text>{{item.value.takeoverUserName || '--'}}</text>
					</view>
					<view><text>处理时间：</text><text>{{item.value.takeoverTime || '--'}}</text></view>
					<view class="log-row-long">
						<text>接班{{item.label}}意见说明：</text>
						<text style="padding-top: 20rpx;">{{item.value.takeoverRemark || '--'}}</text>
					</view>
				</view>
			</view> -->
    </view>
    <view v-else>
      <Empty />
    </view>
  </view>
</template>
<script>
import Empty from '@/components/cu-empty/index.vue'
export default {
  props: {
    data: {
      type: Object
    }
  },
  components: {
    Empty
  },

  data() {
    return {}
  },
  computed: {
    isEmpty() {
      for (var i = 0; i < this.data.changeShiftLogList.length; i++) {
        let logType = this.data.changeShiftLogList[i].logType
        if (logType == '0' || logType == '7') {
          return true
        }
      }
      return false
    }
  }
}
</script>
<style lang="scss" scoped>
.opinion {
  width: 690rpx;
  border-radius: 20rpx 20rpx 20rpx 20rpx;
  opacity: 1;
  margin: 0 auto;
  box-sizing: border-box;
  margin-bottom: 30rpx;
}

.log-row {
  font-size: 28px;
  font-family: PingFang SC-Regular, PingFang SC;
  font-weight: 400;
  color: #333333;
  padding: 30rpx 20rpx 20rpx 30rpx;
  box-sizing: border-box;
  margin-bottom: 30rpx;
  background-color: #fff;
  border-radius: 20rpx;

  & > view {
    margin-bottom: 15rpx;
    display: flex;
    align-items: flex-start;

    & text:first-child {
      color: #666666;
      position: relative;
    }

    & text:last-child {
      color: #333333;
      flex: 1;
      word-break: break-all;
    }
  }

  & > .log-row-long {
    margin-top: 20rpx;
    padding-top: 20rpx;
    border-top: 1rpx solid #d5d7e3;
    flex-direction: column;
  }

  & > view:last-child {
    margin-bottom: 0;
  }
}
</style>
